<?php 
	require(dirname(dirname(__FILE__)). '/init.php');

$unsubStr = "MXwxM3wzNQ==";
//$db = new mysqls("ab");
if(isset($_REQUEST['unsubSubmit'])){
	$client = new client();
	$email = $_REQUEST['email'];
	
	$unsubs = base64_decode($unsubStr);
	$unsubArr = explode("|",$unsubs);
	$unsubId = $unsubArr[0];
	$type = $unsubArr[1];
	$templateId = $unsubArr[2];

	
    $ip = $client->get_user_ip();
	$brownserType = $client->get_user_agent();
	$brownserLanguage = $client->get_user_lang();
	$userOs = $client->get_user_os();
    $timeStamp = time();
	
    $sql = "insert into unsub(email,emailId,timestamps,userBrowser,userIp,type,templateId) values('".$email."','".$unsubId."',".$timeStamp.",'".$brownserType."','".$ip."',".$type.",".$templateId.")";
    $GLOBALS['db']->dbquery($sql);
    header('Location:http://www.kuangjia.com/extra/subscribe/unsubOK.htm');
}
?>


<!doctype html>
<html lang="en">
    <head>

        <meta charset="utf-8">
        <meta name="description" content="">
        <meta name="author" content="">

        <title>HAIR EXTENSIONS</title>

        <!-- Google Fonts -->
        <link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet'>
        <link href='http://fonts.googleapis.com/css?family=Orbitron' rel='stylesheet'>

        <!-- CSS -->
        <link href="css/reset.css" rel="stylesheet">
        <link href="css/style.css" rel="stylesheet">

        <!-- Javascript -->
        <script src="js/jquery.min.js"></script>
        <script src="js/TweenMax.min.js"></script>
        <script src="js/EasePack.min.js"></script>
        <script src="js/CSSPlugin.min.js"></script>
        <script src="js/jquery.countdown.js"></script>
        <script src="js/js.js"></script>
<style type="text/css">
body {
    background: #010207 url(../img/backgrounds.jpg) 0 0 no-repeat;
    font: 18px/1.2 Lato, sans-serif;
    position: relative;
    text-align: center;
}
</style>
    </head>

    <body class="direction-right">

        <!-- STARS -->
<!--	    <div class="stars large"></div>
	    <div class="stars small"></div>-->
        <!-- /STARS -->

        <!-- CONTENT -->
        <div id="content">

            <!-- LOGO -->
            <img src="img/logo.png" alt="Through The Universe">
            <!-- /LOGO -->

            <!-- PANEL -->
            <div id="panel">
                <!-- UNDER CONSTRUCTION -->
                <h1>Hair Extension Kingdom</h1>
                <!-- /UNDER CONSTRUCTION -->

                <!-- SUBSCRIBE -->
                <div id="subscribe">
                    <!-- SUBSCRIPTION HEADER -->
                    <p>We are so sorry about you are not interested in this info!</p>
                    <!-- /SUBSCRIPTION HEADER -->

                    <!-- SUBSCRIPTION FORM -->
                    <form id="subscribe-form" action="" method="POST">
                        <input type="hidden" id="unsubId" name="unsubId" placeholder="unsubId" value="<?php echo $unsubStr;?>">
                        <input type="text" id="subscribe-email" name="email" placeholder="Enter Email">
                        <input type="submit" id="subscribe-button" name="unsubSubmit" value="Unsubscribe">
                    </form>
                    <!-- /SUBSCRIPTION FORM -->
                </div>
                <!-- /SUBSCRIBE -->

                <!-- DESCRIPTION -->
                <p id="description">We &nbsp;&nbsp;are &nbsp;&nbsp;gonna &nbsp;&nbsp;go&nbsp;&nbsp; build &nbsp;&nbsp;our&nbsp;&nbsp; own&nbsp;&nbsp; theme &nbsp;&nbsp;park, &nbsp;&nbsp;with&nbsp;&nbsp; blackjack&nbsp;&nbsp; and &nbsp;&nbsp;hookers. </p>
                <!-- /DESCRIPTION -->

                <!-- SOCIAL -->
                <div id="social">
                    <a href="https://www.twitter.com/hairskingdom" target="_blank">
                        <img src="img/social-twitter.png" alt="Twitter" border="0">                    </a>

                    <a href="https://www.facebook.com/kingdom.hairextension">
                        <img src="img/social-facebook.png" alt="Facebook" border="0">                    </a>

                    <a href="http://www.google.com">
                        <img src="img/social-google.png" alt="Google Plus" border="0">                    </a>				</div>
                <!-- /SOCIAL -->

                <!-- POST SCRIPTUM -->
                <p id="postscriptum">Any question,send us a letter to <a href="mailto:hairextensionkingdom@yahoo.com">hairextensionkingdom@yahoo.com</a></p>
                <!-- /POST SCRIPTUM -->
            </div>

            <!-- COUNTDOWN -->
            <div id="countdown">
                <div>
                    <div class="days"></div> <!-- number container -->
                    <div class="countdown-text"><?php echo date("Y",time());?></div>
                </div>

                <div>
                    <div class="hours"></div> <!-- number container -->
                    <div class="countdown-text"><?php echo date("m",time());?></div>
                </div>

                <div>
                    <div class="minutes"></div> <!-- number container -->
                    <div class="countdown-text"><?php echo date("d",time());?></div>
                </div>

                <div>
                    <div class="seconds"></div> <!-- number container -->
                    <div class="countdown-text"><?php echo date("H:i:s",time());?></div>
                </div>
            </div>
            <!-- /COUNTDOWN -->

        </div>
        <!-- /CONTENT -->

        <!-- VERTICAL ALIGN HELPER -->
        <div id="helper"></div>
        <!-- /HELPER -->

</body>
</html>